package com.yitong.base.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class Constant {
	
	/**
	 * 分页操作的常量
	 */
	public static final int NUMPERPAGE = 20;
	public static final int PAGENUMSHOWN = 10;

	@SuppressWarnings("rawtypes")
	public static List list = new ArrayList();
	public static Map<Object, Properties> propMap = new HashMap<Object, Properties>();

	public final static int PAGE_SIZE = PropertiesUtil.getIntEntryValue("constant.properties", "PAGE_SIZE", 10);// Integer.parseInt(Tools.getProperty("/constant.properties","PAGE_SIZE", "10"));//cacheConfig.getInt("PAGE_SIZE");
	public static int DEFAULT_PAGE_SIZE = PropertiesUtil.getIntEntryValue("constant.properties", "DEFAULT_PAGE_SIZE", 15);// Integer.parseInt(Tools.getProperty("/constant.properties","DEFAULT_PAGE_SIZE", "10"));//cacheConfig.getInt("PAGE_SIZE");
	public static final int BUFFER_SIZE = PropertiesUtil.getIntEntryValue("constant.properties", "BUFFER_SIZE", 1024000); // Integer.parseInt( Tools.getProperty("/constant.properties","BUFFER_SIZE", "1024000")); //cacheConfig.getInt("BUFFER_SIZE");
	public final static int UP_SIZE = PropertiesUtil.getIntEntryValue("constant.properties", "UP_SIZE", 1024000); // Integer.parseInt( Tools.getProperty("/constant.properties","UP_SIZE", "1024"));//cacheConfig.getInt("UP_SIZE");
	public final static int FILE_COPY_SIZE = PropertiesUtil.getIntEntryValue("constant.properties", "FILE_COPY_SIZE", 1024000);// Integer.parseInt( Tools.getProperty("/constant.properties","FILE_COPY_SIZE", "1024")); //cacheConfig.getInt("FILE_COPY_SIZE");
	public static String SYS_LIB_PATH = PropertiesUtil.getEntryValue("constant.properties", "SYS_LIB_PATH", "/syslib"); // Tools.getProperty("/constant.properties", "SYS_LIB_PATH", "/syslib");
	public static String JAVA_HOME_BIN = PropertiesUtil.getEntryValue("constant.properties", "JAVA_HOME_BIN", null); // Tools.getProperty("/constant.properties", "JAVA_HOME_BIN",null);
	public static final String KEY_DISPATCH_SERVER_MONITOR_INFO = "KEY_DISPATCH_SERVER_MONITOR_INFO";
	public static String USER_UPLOAD_SERVER_KEY = PropertiesUtil.getEntryValue("constant.properties", "USER_UPLOAD_SERVER_KEY", ""); // Tools.getProperty("/constant.properties", "USER_UPLOAD_SERVER_KEY");

	// 设置文件内存读写的大小
	public static final long MEMORY_READ_SIZE = PropertiesUtil.getLongEntryValue("constant.properties", "MEMORY_READ_SIZE", 1024000L); // Integer.parseInt( Tools.getProperty("/constant.properties","MEMORY_READ_SIZE", "1024000"));

	/*** 数据库操作类 **/
	public final static String INSERT_ERR_MSG = "对数据库执行插入时错误!";
	public final static String UPDATE_ERR_MSG = "对数据库执行修改时错误!";
	public final static String DELETE_ERR_MSG = "对数据库执行删除时错误!";
	public final static String LOAD_ERR_MSG = "对数据库执行查询单条记录时错误!";
	public final static String FIND_ERR_MSG = "对数据库执行查询多条记录时错误!";
	public final static String EXISTS_ERR_MSG = "对数据库执行判断记录是否存在时错误!";
	public final static String COUNT_ERR_MSG = "对数据库执行查询记录数时错误!";

	public final static String MSG_Exception = "{\"error\":\"没有找到相关的数据\"}";

	public static String WAUS_RESOURCE_PATH = PropertiesUtil.getEntryValue("constant.properties", "WAUS_RESOURCE_PATH", "http://115.29.206.228:80/Skuaiditu-managerCms/");
	// 图片格式
	public static String FILE_TYPE_PICTUER = PropertiesUtil.getEntryValue("constant.properties", "FILE_TYPE.PICTUER", "bmp,jpg,jpeg,gif,png");

	public static String JSON_OUT_PRINT = "JSON_OUT_PRINT";
	// /**我的学习分页**/
	// public static int PAGE_SIZE_MYCOURSE = PropertiesUtil.getIntEntryValue("constant.properties", "PAGE_SIZE_MYCOURSE");
	//
	// public final static String IPSection = PropertiesUtil.getEntryValue("constant.properties", "IP_SECTION");
	//
	public final static String BASE_URL = PropertiesUtil.getEntryValue("constant.properties", "BASE_URL", "http://115.29.206.228:80/Skuaiditu-managerCms/");
	// // public final static String AUTH_URL = PropertiesUtil.getEntryValue("constant.properties", "AUTH_URL","http://115.29.206.228:80/authorService");
	public final static String AUTH_URL = "http://115.29.206.228:80/SauthorService/";

	// Action:静态变量
	public final static String ACTION_creator = "creator";
	public final static String ACTION_updateOrCreateTask = "updateOrCreateTask";
	public final static String ACTION_find = "find";
	public final static String ACTION_search = "search";
	public final static String ACTION_upend = "upend";
	// 分页
	public static final String SERVICE_PAGE_NO = "pageNo";
	public static final String SERVICE_PAGESIZE = "pageSize";
	public static final String SERVICE_STAR = "star";
	public static final String SERVICE_END = "end";
	public static final String SERVICE_CurrentPage_ = "currentPage";
	public static final String SERVICE_TotalPage = "totalPage";
	public static final int SERVICE_pageSize_max = 100;
	public static final String SERVICE_PAGE_DATA = "data";

	/**
	 * 拦截器常量
	 */
	public static final String INTERCEPTOR_CLEANUP = "cleanup_recursion_counter";
	public static final String INTERCEPTOR_ACTION_MAPPING = "struts.actionMapping";
	public static final String INTERCEPTOR_VALUE_STACK = "struts.valueStack";

	/**
	 * indexAction用
	 */
	public final static String constant_properties = "constant.properties";
	public final static String BASE_IMAGE_PATH = PropertiesUtil.getEntryValue(constant_properties, "BACKGROUND_IMAGE_PATH");
	public final static String DEFAULT_INDEX_IMAGE_PATH = BASE_URL + BASE_IMAGE_PATH;
	public final static String DEFAULT_INDEX_IMAGE = "imageIndexUrl";
	public static String INDEX_ACTION = "welcome";
	public final static String DETAULT_IP_SECTION = PropertiesUtil.getEntryValue(constant_properties, "IP_SECTION", "111.0.0.1-192.168.1.250");

	// 找到某一个菜单下所有菜单的接口
	public static String RIGHT_SUB_ACTION = "rightSub.action?";
	public static String MESSAGE_CODE = "code";
	public static String MESSAGE_INFO = "info";
	public static String MESSAGE_MESSAGE = "message";

	// 获得当前登录用户下所有用户接口 根据orgId查询
	public static String USER_LIST_BY_ORGID_ACTION = "userListByOrgId.action?";
	// 权限项目的用户登录接口
	public static String USERLOGIN_ACTION = "userLogin.action?";
	public static String URL_SPLIT = "&";
	public static String SESSION_LOGIN_USER = "SESSION_LOGIN_USER";
	public static String SESSION_LOGIN_USER_ORG = "SESSION_LOGIN_USER_ORG";
	// 权限项目的用户登陆后，找到最顶级菜单接口
	public static String USER_RRIGHT_TOP_ACTION = "userRightTop.action?";

	public final static String JS_STR_SUCCESS = "200";
	public final static String JS_STR_ERROR = "500";

	public static String PIC_SPLIT = "#######";

	// 微信发送下单成功接口URL
	public static String WX_POST_URL = "http://kuaiditu.com/kuaidituwx/interface/sendMsg";

	// 后台取消订单，发微信消息URL
	public static String WX_POST_URL_CANCLE = "http://kuaiditu.com/kuaidituwx/interface/sendMsgByText";

	// 后台取消订单，发微信消息URL
	public static String WX_POST_URL_MANTRA = "http://kuaiditu.com/kuaidituwx/interface/sendMsgByText";
	
	//Android极光推送key和秘钥
	public static final String appKey ="e252753d4a01ce21873f7bb1";
	public static final String masterSecret = "f9c4b4c22bfdd7e2d2020cba";
	
	//Ios极光推送key和秘钥
	public static final String appKeyIOS ="62b8f45fe3ec33208a84af7b";
	public static final String masterSecretIOS = "89a93058cb9b0a34b1c48224";
	
	//用户板极光推送key和秘钥
	public static final String userAppKey ="191e36027dacf6e82229db7d";
	public static final String UsermasterSecret = "fb68739d00c2328a3aa7042a";
	
	//兔兔侠极光推送key和秘钥
	public static final String tutuXiaAppKey ="410d85f4d2967fd5bc99e4cd";
	public static final String tutuXiamasterSecret = "6f66d0f35aa9be231880b89b";
	
	//APP上传图片的路径
	public static String defaultPhotoUrl="http://115.29.206.228/kuaidituInphone";
	
	//快递兔的快递公司Id
	public static String KDTNetSiteIdList="123,124,125,126,127";
	
}
